; Based on use of Prologix USD to GBP converter (or clone of this); Based on use of Prologix USD to GBP converter (or clone of this)
; Set up the converter to correct GPIB channel before use.


#idString PHILIPS, PM6685,
#name Fluke PM6685
#handle PM6685
#port com
#baudrate 9600N81
#eol \n

#author aronake

#interfaceType Counter
#interface readValue 0

; A list of possible column name with unit and formatter (SI, Time, Int, D0..D6)
#value Frequency Hz SI9 Frequency
#value Period s SI9 Period
#value Duty_cycle % D Duty_Cycle
#value Pulse_Width s SI9 Pulse_Width
#value Count n s Count

; How to poll for data, this is used for table and #values?
; a #askMode, #cmdMode and #prepareSample is used before this is string is used.
; This is a single line command

#askValues [MODE:Frequency,Period,Duty_Cycle,Pulse_Width]:Read?;[MODE:Count]:FETC:ARR? -1;


#askModeMathFormat replace(value," ","")
#readingDelay 6
#modeChangeDelay 2

#askMode FUNC?
#initCmd  
*RST


#finalCmd 
:system:local

#interfaceType DMM BMM
#interface readValue 0

#cmdModeLayout 1 4

#cmdMode Frequency FREQ1
*cls;
:CONF:FREQ

#cmdMode Period PER1
*cls;
:CONF:PER

#cmdMode Duty_Cycle PDUT1
*cls;
:CONF:PDUT

#cmdMode Pulse_Width PWID1
*cls;
:CONF:PWIDth

#cmdMode Count TOT1
*cls;
:CONF:TOT:CONT
:INIT:CONT ON
;:TOT:GATE ON


#cmdSetup number Measure_Time 
:read: :Acquisition:APERture?
:readformat: 
:write: :Acquisition:APERture
:tip: Set the measurement time
S 800n 0.2


#cmdSetup radio Measure_Time
:read: :Acquisition:APERture?
:readformat: 
:write: :Acquisition:APERture
:tip: Set the measurement time
1mS 0.001
10mS 0.01
0.1S 0.1
0.2S 0.2

#cmdSetup radio Average 
:read: :AVERage:STATe?
:readformat: 
:write: :AVERage:STATe
:tip: Set the measurement time
On 1
Off 0



#cmdSetup radio Auto_Trig_Level 
:read: :INP:LEV:AUTO?
:readformat: 
:write: :INP:LEV:AUTO
:tip: Turn off make measurement faster
On 1
Off 0

#cmdSetup radio Display 
:read: :DISP:ENAB?
:readformat: 
:write: :DISP:ENAB
:tip: Turn off make measurement faster
On 1
Off 0



#cmdSetup radio LP_Filter 
:read: :INPut:FILTer?
:readformat: 
:write: :INPut:FILTer
:tip: 100kHz Low pass filter
On 1
Off 0

#cmdSetup buttons Count
:write: TOT:GATE
:tip: Use sense wires to get exact voltage at target
Stop  OFF
Start ON

#cmdSetup button Reset_Count
:write: :CONF:TOT:CONT;:INIT:CONT ON







